package com.bxj.wxtt.service.impl;

import com.bxj.wxtt.api.domain.AdvRelation;
import com.bxj.wxtt.mapper.master.AdvRelationMasterMapper;
import com.bxj.wxtt.mapper.slave.AdvRelationSlaveMapper;
import com.bxj.wxtt.service.AdvRelationService;
import com.ifeng.matrix.common.domain.PageResult;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;

/**
 * 由MyBatis Generator工具自动生成 2018-07-18 19:49:05
 */
@Component("advRelationService")
public class AdvRelationServiceImpl implements AdvRelationService {
    @Resource
    AdvRelationMasterMapper advRelationMasterMapper;

    @Resource
    AdvRelationSlaveMapper advRelationSlaveMapper;

    public List<AdvRelation> getAdvRelationList(AdvRelation advRelation) {
        return advRelationSlaveMapper.getAdvRelationList(advRelation);
    }

    public AdvRelation selectById(Integer id) {
        return advRelationSlaveMapper.selectById(id);
    }

    public PageResult<AdvRelation> getAdvRelationPage(AdvRelation advRelation) {
        PageResult pageResult = new PageResult();
        pageResult.setCount(advRelationSlaveMapper.countSeletive(advRelation));
        pageResult.setResult(advRelationSlaveMapper.getAdvRelationList(advRelation));
        return pageResult;
    }

    public int insert(AdvRelation advRelation) {
        return advRelationMasterMapper.insert(advRelation);
    }

    public int deleteAdvRelationById(Integer id) {
        return advRelationMasterMapper.deleteAdvRelationById(id);
    }

    public int updateAdvRelationById(AdvRelation advRelation) {
        return advRelationMasterMapper.updateAdvRelationById(advRelation);
    }
}